<template>
    <!-- <el-form-item :label="data.label" :label-width="data.labelStyle.width"> -->
      <el-radio-group v-if="model" v-model="model[data.fieldId]">
        <el-radio :label="r.value" v-for="r in data.selections" :key="r.value">{{r.label}}</el-radio>
      </el-radio-group>
      <el-radio-group v-else v-model="data.value">
        <el-radio :label="r.value" v-for="r in data.selections" :key="r.value">{{r.label}}</el-radio>
      </el-radio-group>
    <!-- </el-form-item> -->
</template>

<script>
export default {
  name: 'TpRadio',
  props: {
    data: {
      type: Object,
      required: true
    },
    model: Object
  }
}
</script>